﻿<Window x:Class="FacebookTestUserManager.ManagerWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{Binding ElementName=appName, Path=Text}" Height="600" Width="800">
    <StackPanel>
        <StackPanel Orientation="Horizontal">
            <TextBlock x:Name="appName" FontSize="18"></TextBlock>
        </StackPanel>
        <Border>
            <StackPanel>
                <TextBox>Useage:</TextBox>
                <TextBlock>1.Create New Test User.</TextBlock>
                <TextBlock>2.Click "To Login Page" to log in as the Test User.</TextBlock>
                <TextBlock>3.After "To Login Page", Click "To App Profile Page" to go to your application profile page.</TextBlock>
            </StackPanel>
        </Border>
        <StackPanel Orientation="Horizontal">
            <StackPanel.Resources>
                <Style TargetType="Button">
                    <Setter Property="Margin" Value="5" />
                    <Setter Property="FontSize" Value="16"/>
                </Style>
            </StackPanel.Resources>
            <Button x:Name="newTester" Content="New Test User" Click="newTester_Click" />
            <Button x:Name="updateList" Content="Update List" Click="updateList_Click"  />
            <Button x:Name="showCorrelation" Content="Relation Map" Click="showCorrelation_Click" />
            <Button x:Name="deleteAllTester" Content="Delete All Users" Click="deleteAllTester_Click"/>
        </StackPanel>
        <DataGrid AutoGenerateColumns="False" HorizontalAlignment="Stretch" 
                  VerticalAlignment="Stretch" Name="dataGrid1" Height="400"
                  ItemsSource="{Binding}" CanUserAddRows="False">
            <DataGrid.Columns>
                <DataGridTemplateColumn Header="ID">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding id}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="To Login Page">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock>
                                <Hyperlink NavigateUri="{Binding login_url}" Click="OnHyperlinkClick">
                                    <TextBlock Text="Go"/>
                                </Hyperlink>
                            </TextBlock>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="To App Profile Page">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock>
                                <Hyperlink NavigateUri="{Binding login_url}" Click="OnProfileHyperlinkClick">
                                    <TextBlock Text="Go"/>
                                </Hyperlink>
                            </TextBlock>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="Friend Stting">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock>
                                <Hyperlink x:Name="friendsSetting" Click="friendsSetting_Click" DataContext="{Binding idAndToken}">Set</Hyperlink>
                            </TextBlock>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="Delete">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button x:Name="deleteTester" Content="Delete" Click="deleteTester_Click" Margin="2" DataContext="{Binding id}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="URL of Login Page">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding login_url}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
    </StackPanel>
</Window>
